package com.sb.async;

import com.sb.crawler.BaseCrawler;
import com.sb.entity.ActionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * Created by wujunzhou on 2017/11/1.
 */
@Service
public class AsyncTaskService {
    private  final Logger logger= LoggerFactory.getLogger(AsyncTaskService.class);
    @Async
    public void executeAsyncTask(BaseCrawler baseCrawler, ActionContext actionContext){
        try {
            baseCrawler.sbcx(actionContext);
        } catch (Exception e) {
            logger.info(e.getMessage(), e);
        }
    }
}
